package com.power.using.sharlockchat.dialog;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.view.Display;
import android.view.WindowManager;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.power.using.sharlockchat.R;


/**
 * 作者：author
 * 时间：2017/6/21:10:19
 * 邮箱：
 * 说明：
 */
public class LoaddingDialog extends Dialog {
    private TextView mTextView;
    private String mtitle;
    private Display mDisplay;
    private LinearLayout mLinearLayout;
    public LoaddingDialog(@NonNull Context context, String title) {
        super(context, R.style.loadingDialogStyle);
        this.mtitle=title;
        WindowManager windowManager = (WindowManager) context
                .getSystemService(Context.WINDOW_SERVICE);
        mDisplay = windowManager.getDefaultDisplay();

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.loading_view);
        mTextView= (TextView) findViewById(R.id.loading_text);
        mLinearLayout= (LinearLayout) findViewById(R.id.loading_linear);
        if (mtitle == null) {
            mtitle = "正在加载数据, 请稍后";
        }
        mTextView.setText(mtitle);
        mLinearLayout.getBackground().setAlpha(210);

    }
}
